from api.base_api import BaseTellerApi, BaseUserApi


class CreateLoadProductsApi(BaseTellerApi):
    def __init__(self,
                 daikuanUuidNumber="",
                 daikuanName="测试贷款商品",
                 daikuanHuankuan="每月一日",
                 daikuanTypes=1,
                 daikuanJine="200000",
                 daikuanYue=24,
                 daikuanMeiyueJine="8333.33",
                 daikuanLilv="4.0%",
                 daikuanContent="测试贷款项目介绍",
                 insertTime=""):
        super().__init__()
        self.url = f'{self.host}/kejiyinhangyewuguanli/daikuan/save'
        self.method = 'post'
        self.json = {
            "daikuanUuidNumber": daikuanUuidNumber,
            "daikuanName": daikuanName,
            "daikuanHuankuan": daikuanHuankuan,
            "daikuanTypes": daikuanTypes,
            "daikuanJine": daikuanJine,
            "daikuanYue": daikuanYue,
            "daikuanMeiyueJine": daikuanMeiyueJine,
            "daikuanLilv": daikuanLilv,
            "daikuanContent": daikuanContent,
            "insertTime": insertTime
        }

class ListTellersLoadProductsApi(BaseUserApi):

    def __init__(self):
        super().__init__()
        self.url = f'{self.host}//kejiyinhangyewuguanli/daikuan/page?'
        self.method = 'get'
        self.params = {
            "page": "1",
            "limit": 10,
            "sort": "id",
            "licaicanpinGoumaiDelete": "1",
        }
